Ext.define('PJ.view.studentfeedbackccccp.ViewFeedbackFrame', {
    extend: 'AM.default.DefaultWindowForm',
    requires: ['AM.default.DefaultDateField', 
               'AM.default.DateTime', 
               'AM.default.jsonp.DefaultSubmitJsonp',
               'PJ.view.studentfeedbackministries.ViewFeedbackList'
               ],
    
    modal: true,// 开启不允许点击其他组件
    frame: true,
    notEdit: true,
    width: 735,
    height: 645,
    isSame: false,
    isEdit: null,

    initComponent: function(){
    	var me = this;
    	me.items= [{
    		xtype: "fieldset",
    		layout: 'column',
            collapsible: false, //显示三角
            defaults: {
    			xtype: 'textfield',
            	labelAlign: 'right',
            	labelWidth: 65,
            	readOnly: true,
            	fieldCls: 'noBorder',
            	columnWidth: .5
            },
    		items: [{
    			fieldLabel: '班级名称',
    			name: 'classMainName',
            	columnWidth: 1
    		}, {
    			fieldLabel: '承办部委',
    			name: 'trainingDeptName'
    		}, {
    			fieldLabel: '举办时间',
    			name: 'learnTime'
    		}]
    	}, {
    		xtype: "fieldset",
    		layout: 'column',
    		height:'400px',
            collapsible: false, //显示三角
            height:495,
    		items: [{
    			xtype: 'st_viewSignupStatusList',
            	columnWidth: 1,
            	height:470,
                listeners: {
                	selectionchange: function(selModel, selected){
                		this.down('#' + this.oldId + 'Unlock').setDisabled(selected.length === 0);
                	},
                	viewready: function(){
                		this.addDocked([{
                            dock: 'top',
                            xtype: "searchform",
                			columnCount: 2,
                			collapsedFieldSet: false,
                            fieldDefaults: {
                                xtype: "textfield",
                                labelAlign: 'right',
                                labelWidth: 80
                            },
                            items: [{
                                fieldLabel: '学员帐号',
                                name: "searchLoginID",
                                emptyText: "请输入学员帐号",
                                maxLength: 50
                            }, {
                                fieldLabel: "姓名",
                                name: "searchUserName",
                                emptyText: "请输入姓名",
                                maxLength: 100
                            },{
            					xtype: "combo",
            					fieldLabel: '评价状态',
            					name: "appraiseStatus",
            					store: Ext.create("Ext.data.ArrayStore", {
            						fields: ['value', 'text'],
            						data: [[1, '未评价'],[2,'已评价']]
            					}),
            					valueField: 'value',
            					displayField: 'text',
            					editable: false,
            					emptyText: "请选择"
            				}],
                			onResetClick: function(button){
                                var form = button.up('form');
                                var gridPanel = form.grid;
                                var newParams = {
                        				searchClassID: gridPanel.up('window').classId,
                        				auditingState: 1
                                };
                                gridPanel.getStore().proxy.extraParams = {};
                                var params = gridPanel.getStore().proxy.extraParams;
                                Ext.apply(params, newParams);
                                form.getForm().reset();
                            },
                            grid: this
                        },{
                            xtype: 'toolbar',
                            dock: 'top',
                            displayInfo: true,
                            items: [{
                                text: '解锁',
                                iconCls: 'keyStudentIco',
                                itemId: this.oldId + "Unlock",
                                disabled: true,
                                scope: this,
                                handler: this.onUnlockClick
                            }]
                        }]);
                		// 触发权限过滤事件
                		this.fireEvent("permission", this);
                		var params = this.store.proxy.extraParams;
                		var newParams = {
                				searchClassID: this.up('window').classId,
                				auditingState: 1
                		};
                		Ext.apply(params, newParams);
                		this.store.isLoad = true;
                		this.store.load();
                	}
                }
    		}]
    	}];
        me.buttons = [{
            text: '关闭',
            scope: this,
            handler: this.close
        }];
        me.callParent(arguments);
    },

    listeners: {
    	close: function(){
    		this.grid.store.load();
    	}
    	/*afterrender: function(){
    		var win = this;
    		var baseForm = win.down('form').getForm();
    		var classMainName = baseForm.findField('className');//班级名称
    		var ministrieName = baseForm.findField('ministrieName');//委托部委
    		var learnTime = baseForm.findField('learnTime');//举办时间

    		classMainName.setValue(win.className);
    		ministrieName.setValue(win.ministrieName);
    		learnTime.setValue(win.beginDate + '至' + win.endDate);
    	}*/
    }
});
